using System;
namespace APP.HELPER.Utils.BarcodeLib
{
	internal class Standard2of5 : BarcodeCommon, IBarcode
	{
		private string[] S25_Code = new string[]
		{
			"11101010101110",
			"10111010101110",
			"11101110101010",
			"10101110101110",
			"11101011101010",
			"10111011101010",
			"10101011101110",
			"10101110111010",
			"11101010111010",
			"10111010111010"
		};
		public string Encoded_Value
		{
			get
			{
				return this.Encode_Standard2of5();
			}
		}
		public Standard2of5(string input)
		{
			this.Raw_Data = input;
		}
		private string Encode_Standard2of5()
		{
			if (!BarcodeEdit.CheckNumericOnly(this.Raw_Data))
			{
				throw new Exception("ES25-1: Numeric Data Only");
			}
			string str = "11011010";
			string raw_Data = this.Raw_Data;
			for (int i = 0; i < raw_Data.Length; i++)
			{
				char c = raw_Data[i];
				str += this.S25_Code[int.Parse(c.ToString())];
			}
			return str + "1101011";
		}
	}
}
